package com.yy.service.impl;

import cn.hutool.core.io.unit.DataUnit;
import com.yy.domain.ParkDevice;
import com.yy.mapper.ParkDeviceMapper;
import com.yy.service.ParkDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ParkDeviceServiceImpl implements ParkDeviceService {
    @Autowired
    private ParkDeviceMapper parkDeviceMapper;

    /**
     * 查询匝道设备列表
     * @param parkDevice
     * @return
     */
    @Override
    public List<ParkDevice> selectParkDeviceList(ParkDevice parkDevice) {
        return parkDeviceMapper.selectParkDeviceList(parkDevice);
    }

    @Override
    public String selectParkDeviceById(Long id) {
        return parkDeviceMapper.selectParkDeviceById(id);
    }

    @Override
    public int insertParkDevice(ParkDevice parkDevice) {
        parkDevice.setCreateTime(new Date());
        return parkDeviceMapper.insertParkDevice(parkDevice);
    }
    /**
     * 修改匝道设备管理
     *
     * @param parkDevice 匝道设备管理
     * @return 结果
     */
    @Override
    public int updateParkDevice(ParkDevice parkDevice) {
        parkDevice.setUpdateTime(new Date());
        return parkDeviceMapper.updateParkDevice(parkDevice);
    }

    /**
     * 批量删除匝道设备管理
     *
     * @param ids 需要删除的匝道设备管理主键
     * @return 结果
     */
    @Override
    public int deleteParkDeviceByIds(Long[] ids)
    {
        return parkDeviceMapper.deleteParkDeviceByIds(ids);
    }

    /**
     * 删除匝道设备管理信息
     *
     * @param id 匝道设备管理主键
     * @return 结果
     */

    public int deleteParkDeviceByIds(Long id)
    {
        return parkDeviceMapper.deleteParkDeviceById(id);
    }
}
